log("Init: " + Math.sqrt(25));

setup();
var state;

function setup() {
  log("setup");

  log("Creating some global state");
  
  state = {  
      foo: function() {
        log("Called foo on state");
      },
      x: 100,
      bar: function() {
        state.x ++;
        return state.x;
      } 
    };
}

function map(value) {
  log("Mapped: " + value);
  for(var i = 0; i < 100; i++) {
    log("Calling bar(): " + state.bar());
  }
}
